package com.jiang.竞赛.Round76.A;

import java.util.Scanner;

/**
 * @author Jiang
 * @version 1.0
 * @date 2025/01/12 23:26
 */
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        int res = 0;
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int day = in.nextInt();
            res += 15 * (day / 7);

            int remainder = day % 7;
            if (remainder > 5) {
                res += 15;
            } else {
                res += 3 * remainder;
            }
        }
        System.out.print(res);
    }
}
